import React, { useContext } from 'react'
import { ContextAPI } from '../../App'
import { Observer } from 'mobx-react'

//测试板块

function Test() {
  const context = useContext(ContextAPI)

  return (
    <div>
      <Observer>
        {
          () => (
            <div>
              <p>{context.test.a}</p>
              <p>{context.c}</p>
              <button onClick={() => context.test.addA()}>add</button>
            </div>
          )
        }
      </Observer>
      <h1>文件上传</h1>
      <form action="http://localhost:5000/upload" method="post" enctype="multipart/form-data">
        <input id="files" type="file" name="file" multiple />
        <input type="submit" value="上传" />
      </form>
    </div>
  )
}

export default Test